package com.lmt_exception;

public class ExceptionTest {
    public static void main(String[] args) {
        try{
            saveAge(160);
            System.out.println("正常");
        }catch (Exception e)
        {
            e.printStackTrace();
            System.out.println("出现bug");
        }
    }

    private static void saveAge(int age) throws AgeIllegalException {
        if (age > 0 && age < 100){
            System.out.println("年龄正常");
        }else {
            throw new AgeIllegalException("/age is illegal, your age is" + age);
        }

    }
}
